/*
 * @Author: 颜礼田 2564217790@qq.com
 * @Date: 2024-08-27 14:17:57
 * @LastEditors: 颜礼田 2564217790@qq.com
 * @LastEditTime: 2024-09-07 16:59:47
 * @FilePath: /turo-repo-enterprise/apps/fuck-enterprise-admin/src/api/modules/roles.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import http from "@/api";
import { PORT1 } from "@/api/config/servicePort";
import { Id, ReqPage } from "../interface";
import { RoleSchema } from "@/schema";

export type Role = RoleSchema;

export function fetchRoleList(data: ReqPage) {
  return http.post<Role>(`${PORT1}/role/list`, data);
}

export function saveRole(data: Role) {
  return http.post<Role>(`${PORT1}/role/save`, data);
}

export function editRole(params: Id, data: Role) {
  return http.put<Role>(`${PORT1}/role/edit`, data, { params });
}

export function fetchRoleInfo(params: Id) {
  return http.get<Role>(`${PORT1}/role/info`, params);
}

export function removeRole(params: Id) {
  return http.delete<Role>(`${PORT1}/role/remove`, params);
}
